<?php
// 1.字符串长度
$string = "abcdefghijklmnopqrstuvwxyz";
$length = strlen($string);
echo $length; // 26

// 2.trim去除空格
$string = " abcdefghijklmno pqrstuvwxyz ";
$trim = trim($string);
echo $trim, strlen($string) . PHP_EOL;

//根据format生成字符串
$format = "mortal is in %s,he love this city.he is %d years old";
$format_string = sprintf($format, "shanghai", 18);
echo $format_string . PHP_EOL;
